package com.alex.xmlyfm.entities.discoverrecommend;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.LinkedList;
import java.util.List;

/**
 * Created by
 * Author: alex
 * Email:
 * Date: 15-10-21.
 */
public class DiscoverRecommendColumns extends DiscoverRecommendItem {
    private List<DiscoverColumns> discoverColumnses;

    public List<DiscoverColumns> getDiscoverColumnses() {
        return discoverColumnses;
    }

    public void parseJSON(JSONObject json) throws JSONException {
        if (json != null) {
            super.parseJSON(json);
            int ret = json.optInt("ret");
            JSONArray array = json.getJSONArray("list");

            int len = array.length();
            discoverColumnses = new LinkedList<>();
            for (int i = 0; i < len; i++) {
                DiscoverColumns discoverColumns = new DiscoverColumns();
                discoverColumns.parseJSON(array.getJSONObject(i));
                discoverColumnses.add(discoverColumns);
            }
        }

}

}
